﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.Interface;

namespace Domain
{
    public class CommunityComponent : BaseComponent, ICommunityComponent
    {

        /// <summary>
        /// Add resource
        /// </summary>
        /// <param name="resource"></param>
        public void AddResource(Model.NiceResource resource)
        {
            Context.NiceResources.Add(resource);
            Context.SaveChanges();
        }

        /// <summary>
        /// Get Resources
        /// </summary>
        /// <returns></returns>
        public IEnumerable<Model.NiceResource> GetResources()
        {
            return Context.NiceResources.ToList();
        }
    }
}
